package com.syt.service.service;

import com.syt.service.dao.PhoneShowMapper;
import com.syt.service.dao.PhoneTrademarkMapper;
import com.syt.service.pojo.PhoneShow;
import com.syt.service.pojo.PhoneTrademark;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ：syt
 * @date ：Created in 2019-10-02 14:03
 * @description：手机品牌服务类
 */
@Service
public class PhoneTrademarkService {

    @Autowired(required = false)
    PhoneTrademarkMapper mapper;

    /**
     * 删除品牌 根据id
     * @param id
     * @return
     */
    public int deleteById(String id) {
        return mapper.deleteByPrimaryKey(id);
    }

    /**
     * 完全插入 品牌
     * @param trademark
     * @return
     */
    public int insert(PhoneTrademark trademark) {
        return mapper.insert(trademark);
    }

    /**
     * 选择插入 品牌
     * @param trademark
     * @return
     */
    public int insertBySelective(PhoneTrademark trademark) {
        return mapper.insertSelective(trademark);
    }

    /**
     * 根据id查询 品牌
     * @param id
     * @return
     */
    public PhoneTrademark getById(String id) {
        return mapper.selectByPrimaryKey(id);
    }

    /**
     * 选择性更新 品牌
     * @param trademark
     * @return
     */
    public int updateBySelective(PhoneTrademark trademark) {
        return mapper.updateByPrimaryKeySelective(trademark);
    }

    /**
     * 完全更新 品牌
     * @param trademark
     * @return
     */
    public int update(PhoneTrademark trademark) {
        return mapper.updateByPrimaryKey(trademark);
    }


}
